<?php 
define("DATE_FORMAT","dd-mm-yyyy");
define("DATE_TIME_FORMAT","dd-mm-yyyy h:s:i");

function getRequest($name){
	return trim(JRequest::getVar($name));
}

function substrCustom($str,$start,$length)
{
			$len = strlen($str);
			if($start + $length >= $len)
			{
				return $str;
			}

			$temp = 0;
			for($i = $start + $length;$i>=0;$i--)
			{
				if($str[$i] == " " && $str[$i-1] != " ")
				{
					$temp = $i;
					break;
				}
			}
			if(($start + $length) - $temp >=10)
				return substr ($str, $start, $length);
			$lengtemp = $temp - $start;
			return substr($str, $start, $lengtemp);
}
?>